#include "dominion.h"
#include "dominion_helpers.h"
#include <stdio.h>
#include <assert.h>
 
int main() {
    int player1 = 0;
    int card = smithy;
	int hcount, pccount, dcard, hpos;
    struct gameState G;
    int kingdom_cards[10] = {adventurer, council_room, feast, gardens, mine,
        remodel, smithy, village, baron, great_hall};
 
    initializeGame(2, kingdom_cards, 1, &G); // initialize a new game
 
    printf("Testing Smithy card.\n");
 
	hcount = G.handCount[player1];
	pccount = G.playedCardCount;
	hpos = 0;
    dcard = G.hand[player1][hpos];
    
    assert(cardEffect(card, 0, 0, 0, &G, hpos, 0) == 0);
    assert(G.handCount[player1] == hcount + 2); //smithy gives +3, but is then discarded
    assert(G.playedCardCount == pccount + 1);
    assert(G.playedCards[G.playedCardCount-1] == dcard);
 
    printf("Smithy: All tests passed!\n");
 
    return 0;
}
